home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscSoundPalette / MiscSoundTrackerInspector.m < prev    next >
Encoding:
Text File  |  1995-04-17  |  1.7 KB  |  67 lines

  1. /*
  2.  
  3. Version 1.2
  4. Copyright (c) 1995 by Sean Luke
  5. Donated to the MiscKit
  6.  
  7. Permission to use, copy, modify, and distribute this material 
  8. for any purpose and without fee, under the restrictions as noted 
  9. in the MiscKit copyright notice, is hereby granted, provided that
  10. the MiscKit copyright notice and this permission notice 
  11. appear in all source copies, and that the author's name shall not
  12. be used in advertising or publicity pertaining to this 
  13. material without the specific, prior written permission 
  14. of the author.  SEAN O. LUKE  MAKES NO REPRESENTATIONS ABOUT THE
  15. ACCURACY OR SUITABILITY OF THIS MATERIAL FOR ANY PURPOSE.  
  16. IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  17.  
  18. */
  19.  
  20. #import "MiscSoundTrackerInspector.h"
  21. #import "MiscSoundUtil.subproj/MiscSoundTracker.h"
  22.  
  23. @implementation MiscSoundTrackerInspector
  24.  
  25. - init
  26.     {
  27.     char buf[MAXPATHLEN+1];
  28.     id bundle;
  29.     
  30.     [super init];
  31.     bundle=[NXBundle bundleForClass:[MiscSoundTracker class]];
  32.     [bundle getPath:buf forResource:"MiscSoundTrackerInspector" ofType:"nib"];
  33.     [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
  34.     return self;
  35.     }
  36.     
  37.  
  38. - ok:sender
  39.     {
  40.     float r=[refresh floatValue];
  41.     float s=[sampling floatValue];
  42.     if (r<=0){r=SOUNDTRACKER_TIMED_ENTRY_SPEED;[refresh setFloatValue:r];}
  43.     if (s<=0){s=SOUNDTRACKER_DEFAULT_SAMPLING_RATE;[sampling setFloatValue:s];}
  44.     
  45.     [object setSendType:[matrix selectedRow]+1];
  46.     [object setRefresh:r];
  47.     [object setDefaultSamplingRate:s];
  48.     
  49.     return [super ok:sender];
  50.     }
  51.     
  52. - revert:sender
  53.     {
  54.     [matrix selectCellAt:[object sendType]-1:0];
  55.     [refresh setFloatValue:[object refresh]];
  56.     [sampling setFloatValue:[object defaultSamplingRate]];
  57.     
  58.     return [super revert:sender];
  59.     }
  60.     
  61. - (BOOL) wantsButtons
  62.     {
  63.     return NO;
  64.     }
  65.  
  66. @end
  67.